package com.yanggu.flink.datastream_api.async_io

import com.yanggu.flink.datastream_api.accumulate_batch.ProcessTimeMiniBatchOperator
import org.apache.flink.streaming.api.functions.async.AsyncRetryStrategy
import org.apache.flink.streaming.api.scala._

import java.util.concurrent.TimeUnit

object AsyncIoDemo02 {

  def main(args: Array[String]): Unit = {
    val environment = StreamExecutionEnvironment.createLocalEnvironmentWithWebUI()
    environment.setParallelism(1)

    val dataStream = environment
      .socketTextStream("localhost", 7777)
      .transform("MiniBatch", new ProcessTimeMiniBatchOperator())

    //val value = AsyncDataStream.orderedWait(dataStream, null,
    //  1000L, TimeUnit.SECONDS, 100)

    environment.execute()

  }

}
